package com.walter.t3bridge.controller;

import com.walter.dynamic.thread.pool.core.DynamicThreadPoolExecutor;
import com.walter.redis.tools.DistributedLockService;
import com.walter.weixin.bridge.facade.feign.DemoFeign;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Walter
 * @date 2025/1/20 上午12:04
 **/
@RestController
@Slf4j
public class DemoController {
    @Resource
    private DemoFeign demoFeign;
    @Resource
    DynamicThreadPoolExecutor dynamicThreadPoolExecutor;

    @Value("${na.testVal}")
    private String v;

    @Resource
    DistributedLockService distributedLockService;

    @GetMapping("/feign/getUser/{id}")
    public String getUser(@PathVariable("id")Long id) {
        log.info("t3bridge getUser:{}",id);
        return demoFeign.getUser(id);
    }
    @GetMapping("/feign/getId")
    public String getId(@RequestParam("id") Long id) {
        log.info("t3bridge getId:{}",id);
        return demoFeign.getId(id);
    }

    @GetMapping("/getNacosVal")
    public String getNacosVal(){
        log.info("t3bridge getNacosVal:{}",v);
        return "nacos="+v;
    }
}
